﻿using Common;
using System;

namespace IP20.Procdure
{
    internal class TestItem : NotifyBase
    {
        public bool IsChecked { get; set; }

        /// <summary>
        /// 编号
        /// </summary>
        public int No { get; set; }

        /// <summary>
        /// 组编号
        /// </summary>
        public int GroupNo { get; set; }

        /// <summary>
        /// 测试项
        /// </summary>
        public string Item { get; set; }

        /// <summary>
        /// 如果测试失败则结束
        /// </summary>
        public bool BreakIfErr { get; set; }

        /// <summary>
        /// 类型
        /// </summary>
        public string Type { get; set; }

        /// <summary>
        /// 操作方法
        /// </summary>
        public string OperationFun { get; set; }

        /// <summary>
        /// 运算符
        /// </summary>
        public string Operator { get; set; }

        /// <summary>
        /// 参数1
        /// </summary>
        public string Param1 { get; set; }

        /// <summary>
        /// 参数2
        /// </summary>
        public string Param2 { get; set; }

        /// <summary>
        /// 参数3
        /// </summary>
        public string Param3 { get; set; }

        /// <summary>
        /// 参数4
        /// </summary>
        public string Param4 { get; set; }

        /// <summary>
        /// 参数5
        /// </summary>
        public string Param5 { get; set; }

        /// <summary>
        /// 参数6
        /// </summary>
        public string Param6 { get; set; }

        /// <summary>
        /// 测试项描述
        /// </summary>
        public string Desc { get; set; }

        private bool? _result;

        /// <summary>
        /// 执行结果
        /// </summary>
        public bool? Result
        {
            get { return _result; }
            set
            {
                _result = value;
                this.DoNotify();
            }
        }

        private string _message;

        public string Message
        {
            get { return _message; }
            set
            {
                _message = value;
                this.DoNotify();
            }
        }

        private string _passCondition;

        public string PassCondition
        {
            get { return _passCondition; }
            set
            {
                _passCondition = value;
                this.DoNotify();
            }
        }

        public string TestTime { get; set; }

        public Func<TestItem, bool> Excute { get; set; }
    }
}